package cn.dust.design.pattern.behavioral.observer.zhandui;

import java.util.ArrayList;

public abstract class Zhandui {
    protected String allname;
    protected ArrayList<Object> observers=new ArrayList<Object>();

    public String getAllname() {
        return allname;
    }

    public void setAllname(String allname) {
        this.allname = allname;
    }

    public void join(Observer observer){
        System.out.println(observer.getName()+"加入战队");
        this.observers.add(observer);
    }

    public void quit(Observer observer){
        System.out.println(observer.getName()+"离开战队");
        this.observers.remove(observer);
    }

    public abstract void tongzhi();


}
